package com.lc.admin.bean;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.List;
import java.util.Set;

@Data
public class LoginUserDetails implements UserDetails {
    private Long id;
    private String username;
    private String openId;
    private String password;
    private String userType;   // 用户类型（0:系统用户,1:客户）
    private String avatar;
    private String nickName;
    private String email;
    private String realName;
    private String mobile;
    private String sex;
    private String dateState;  //数据状态（0正常 1停用）
    private String deptNo;
    private String postNo;
    private Integer isLeader; // 是否是部门leader(0:否，1：是)
    private Integer isDelete; // 是否删除(0:否，1：是)
    private Set<String> resourceRequestPaths;
    private List<GrantedAuthority> authorities;
    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return authorities;
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
